package com.huatai.bi.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * 数据目录表
 * @TableName tb_directory
 */
@TableName(value ="tb_directory")
@Data
public class DirectoryEntity implements Serializable {

	@TableField(exist = false)
	private static final long serialVersionUID = 1L;

	/**
	 * 数据目录id
	 */
	@TableId(type = IdType.ASSIGN_ID)
	private Long dtId;

	/**
	 * 父级目录id
	 */
	@TableField("p_id")
	@ApiModelProperty(value = "父级目录id")
	private Long pid;

	/**
	 * 目录名称
	 */
	@TableField("name")
	@ApiModelProperty(value = "目录名称")
	private String name;

	@TableField("table_name")
	@ApiModelProperty(value = "数据同步表名称")
	private String tableName;

	@ApiModelProperty(value = "版本号")
	private String version;

	/**
	 * 父子终端设备标识层级（如events.default）
	 */
	@ApiModelProperty("父子终端设备标识层级（如events.default）")
	private String markInfo;

	/**
	 * 创建时间
	 */
	@TableField(value = "create_time",fill = FieldFill.INSERT)
	@ApiModelProperty(value = "创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;

	/**
	 * 更新时间
	 */
	@TableField(value = "update_time",fill = FieldFill.INSERT_UPDATE)
	@ApiModelProperty(value = "更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date updateTime;

	/**
	 * 创建人
	 */
	@TableField(value = "create_by",fill = FieldFill.INSERT)
	@ApiModelProperty(value = "创建人")
	private String createBy;

	/**
	 * 更新人
	 */
	@TableField(value = "update_by",fill = FieldFill.INSERT_UPDATE)
	@ApiModelProperty(value = "更新人")
	private String updateBy;

	@ApiModelProperty(value = "是否是目录")
	@TableField("is_dir")
	private Integer isDir;

	@ApiModelProperty(value = "topic")
	@TableField("topic_info")
	private String topicInfo;

	@ApiModelProperty(value = "数据类型（1：数据接入，2：数据同步）")
	@TableField("data_type")
	private Integer dataType;

	@ApiModelProperty(value = "mqtt客户端ID")
	@TableField("client_id")
	private String clientId;

	/**
	 * 是否删除(1已删除，0未删除)
	 */
	@ApiModelProperty(value = "是否删除(1已删除，0未删除)")
	@TableField("is_deleted")
	@TableLogic
	private Integer isDeleted=0;
}
